import 'package:flutter/material.dart';

class ThirdPage extends StatefulWidget{

  @override
  State<StatefulWidget> createState() {

    return new ThirdPageState();
  }

}

class ThirdPageState extends State<ThirdPage>{

  final TextEditingController _textEditingController = new TextEditingController();

  @override
  Widget build(BuildContext context) {

    return new Scaffold(

      resizeToAvoidBottomPadding: false,//输入框抵住键盘

      body: new SingleChildScrollView(

        child: new Column(

          children: <Widget>[

            new Padding(//pading设置高度，宽度会占满
              padding: new EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 20.0),
              child: new Row(
                children: <Widget>[
                  new Expanded(

                    child: new TextField(

                        controller: _textEditingController,
                        autofocus: false,//是否自动获取焦点，如果是，则进入该界面，键盘会自动打开
                        obscureText: false,//是否是密码
                        keyboardType: TextInputType.text,//输入类型
                        decoration: InputDecoration(//给TextField添加修饰符
                          labelText: '输入用户名',
                          labelStyle: TextStyle(

                            color: Colors.black,
                            fontSize: 14,

                          ),
                          fillColor: Colors.blue.shade100,
                          filled: true,
                          helperText: 'error',
                          prefixText: '用户名:',
                          prefixStyle: TextStyle(
                            color: Colors.red,
                            fontSize: 14,

                          ),
                          prefixIcon: Icon(Icons.local_airport),
                          suffixText: 'airport',
                          suffixIcon: Icon(Icons.panorama_fish_eye),
                      ),

                    ),

                  ),
                ],
              ),
            ),

            new Padding(//pading设置高度，宽度会占满
              padding: new EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 20.0),
              child: new Row(
                children: <Widget>[
                  new Expanded(

                    child: new RaisedButton(
                      onPressed: (){

                        showDialog(
                          context: context,
                          // ignore: deprecated_member_use
                          child: new AlertDialog(
                            title: new Text('你输入的内容:'),
                            content: new Text(_textEditingController.text),
                            actions: <Widget>[

                              new FlatButton(
                                onPressed: (){

                                  Navigator.of(context).pop();

                                },

                                child: new Text('取消'),

                              ),

                              new FlatButton(
                                onPressed: (){

                                  print('你输入的内容是:${_textEditingController.text}');

                                  Navigator.of(context).pop();
                                },

                                child: new Text('确定'),

                              )

                            ],
                          ),

                        );
                      },
                      //通过控制 Text 的边距来控制控件的高度
                      child: new Padding(padding: new EdgeInsets.fromLTRB(10.0, 10.0, 0.0, 10.0),
                        child: new Text("Padding测试Buton的宽度"),
                      ),
                      color: Colors.deepOrange,
                    ),
                  ),
                ],
              ),
            ),

            new Padding(//pading设置高度，宽度会占满
              padding: new EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 20.0),
              child: new Row(
                children: <Widget>[
                  new Expanded(

                    child: new RaisedButton(
                      onPressed: (){

                        showDialog(
                          context: context,
                          // ignore: deprecated_member_use
                          child: new AlertDialog(
                            title: new Text('你输入的内容:'),
                            content: new Text(_textEditingController.text),
                            actions: <Widget>[

                              new FlatButton(
                                onPressed: (){

                                  Navigator.of(context).pop();

                                },

                                child: new Text('取消'),

                              ),

                              new FlatButton(
                                onPressed: (){

                                  print('你输入的内容是:${_textEditingController.text}');

                                  Navigator.of(context).pop();
                                },

                                child: new Text('确定'),

                              )

                            ],
                          ),

                        );
                      },
                      //通过控制 Text 的边距来控制控件的高度
                      child: new Padding(padding: new EdgeInsets.fromLTRB(10.0, 10.0, 0.0, 10.0),
                        child: new Text("RaisedButton-确认"),
                      ),
                      color: Colors.deepOrange,
                      textColor: Colors.black,
                      textTheme: ButtonTextTheme.normal,
                      materialTapTargetSize: MaterialTapTargetSize.padded,
                      onHighlightChanged: (bool b){//水波纹高亮变化回调


                      },
                      disabledTextColor: Colors.black54,//按钮禁用时候文字的颜色
                      disabledColor: Colors.black54,//按钮被禁用的时候显示的颜色
                      highlightColor: Colors.grey,//点击或者toch控件高亮的时候显示在控件上面，水波纹下面的颜色
                      splashColor: Colors.white,//水波纹的颜色
                      colorBrightness: Brightness.light,//按钮主题高亮
                      elevation: 10.0,//按钮下面的阴影
                      highlightElevation: 10.0,//高亮时候的阴影
                      disabledElevation: 10.0,//按下的时候的阴影
            //              shape:,//设置形状  LearnMaterial中有详解

                    ),
                  ),
                ],
              ),
            ),

            new Padding(//pading设置高度，宽度会占满
              padding: new EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 20.0),
              child: new Row(
                children: <Widget>[
                  new Expanded(

                    child: new FlatButton(
                      onPressed: (){

                        showDialog(
                          context: context,
                          // ignore: deprecated_member_use
                          child: new AlertDialog(
                            title: new Text('你输入的内容:'),
                            content: new Text(_textEditingController.text),
                            actions: <Widget>[

                              new FlatButton(
                                onPressed: (){

                                  Navigator.of(context).pop();

                                },

                                child: new Text('取消'),

                              ),

                              new FlatButton(
                                onPressed: (){

                                  print('你输入的内容是:${_textEditingController.text}');

                                  Navigator.of(context).pop();
                                },

                                child: new Text('确定'),

                              )

                            ],
                          ),

                        );
                      },
                      //通过控制 Text 的边距来控制控件的高度
                      child: new Padding(padding: new EdgeInsets.fromLTRB(10.0, 10.0, 0.0, 10.0),
                        child: new Text("FlatButton-确认"),
                      ),
                      color: Colors.deepOrange,
                      textColor: Colors.black,
                      textTheme: ButtonTextTheme.normal,
                      materialTapTargetSize: MaterialTapTargetSize.padded,
                      onHighlightChanged: (bool b){//水波纹高亮变化回调


                      },
                      disabledTextColor: Colors.black54,//按钮禁用时候文字的颜色
                      disabledColor: Colors.black54,//按钮被禁用的时候显示的颜色
                      highlightColor: Colors.grey,//点击或者toch控件高亮的时候显示在控件上面，水波纹下面的颜色
                      splashColor: Colors.white,//水波纹的颜色
                      colorBrightness: Brightness.light,//按钮主题高亮
                      //              shape:,//设置形状  LearnMaterial中有详解

                    ),
                  ),
                ],
              ),
            ),

            new Padding(//pading设置高度，宽度会占满
              padding: new EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 20.0),
              child: new Row(
                children: <Widget>[
                  new Expanded(

                    child: new OutlineButton(
                      onPressed: (){

                        showDialog(
                          context: context,
                          // ignore: deprecated_member_use
                            child: new AlertDialog(
                            title: new Text('你输入的内容:'),
                            content: new Text(_textEditingController.text),
                            actions: <Widget>[

                              new FlatButton(
                                  onPressed: (){

                                    Navigator.of(context).pop();

                                  },

                                  child: new Text('取消'),

                              ),

                              new FlatButton(
                                  onPressed: (){

                                    print('你输入的内容是:${_textEditingController.text}');

                                    Navigator.of(context).pop();
                                  },

                                  child: new Text('确定'),

                              )

                            ],
                          ),

                        );
                      },
                      //通过控制 Text 的边距来控制控件的高度
                      child: new Padding(padding: new EdgeInsets.fromLTRB(10.0, 10.0, 0.0, 10.0),
                        child: new Text("OutlineButton-确认"),
                      ),
                      color: Colors.deepOrange,
                      textColor: Colors.black,
                      textTheme: ButtonTextTheme.normal,
                      disabledTextColor: Colors.black54,//按钮禁用时候文字的颜色
                      highlightColor: Colors.grey,//点击或者toch控件高亮的时候显示在控件上面，水波纹下面的颜色
                      splashColor: Colors.white,//水波纹的颜色
                      highlightElevation: 10.0,//高亮时候的阴影
                      //              shape:,//设置形状  LearnMaterial中有详解

                    ),
                  ),
                ],
              ),
            ),

            new Container(
              constraints: new BoxConstraints.expand(
                height:Theme.of(context).textTheme.display1.fontSize * 1.1 + 200.0,
              ),
              decoration: new BoxDecoration(
                border: new Border.all(width: 2.0, color: Colors.red),
                color: Colors.grey,
                borderRadius: new BorderRadius.all(new Radius.circular(20.0)),
                image: new DecorationImage(
                  image: new NetworkImage('http://h.hiphotos.baidu.com/zhidao/wh%3D450%2C600/sign=0d023672312ac65c67506e77cec29e27/9f2f070828381f30dea167bbad014c086e06f06c.jpg'),
                  centerSlice: new Rect.fromLTRB(270.0, 180.0, 1360.0, 730.0),
                ),
              ),
              padding: const EdgeInsets.all(8.0),
              alignment: Alignment.center,
              child: new Text('Hello World',
                  style: Theme.of(context).textTheme.display1.copyWith(color: Colors.black)),
              transform: new Matrix4.rotationZ(0.3),
            )


          ],

        ),

      )
    );
  }

}